import { http } from '@/utils/http';

export const getServiceCategoryList = (parentId : number) => {
	return http<AnyObj[]>({
		method: 'GET',
		url: `/wx/spu/listCategory`,
		data: {
			parentId
		}
	});
}

export const getServiceList = (parentId : number) => {
	return http<AnyObj[]>({
		method: 'GET',
		url: `/wx/spu/list`,
		data: {
			categoryParentId: parentId,
			parentId: parentId,
			pageSize: 999999
		}
	});
}

export const getAllServiceList = (data : AnyObj) => {
	return http<AnyObj[]>({
		method: 'GET',
		url: `/wx/spu/list`,
		data: {
			pageSize: 999999,
			...data
		}
	});
}

export const getSpuDetail = (spuId : string) => {
	return http<AnyObj>({
		method: 'GET',
		url: `/wx/spu/${spuId}`,
	});
}

export const getSpuCommentList = (data : AnyObj & { spuId : string }) => {
	return http<AnyObj>({
		method: 'GET',
		url: `/wx/spuComment/list`,
		data
	});
}